package com.hb.znpt.adapter;

import android.widget.ImageView;

import androidx.annotation.NonNull;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.hb.znpt.R;
import com.hb.znpt.bean.LeaseBean;
import com.hb.znpt.bean.UpdataBean;

/**
 * @Description: 描述
 * @Author: houbing
 * @CreateDate: 2021/12/17 14:59
 */
public class OfflineAdapter extends BaseQuickAdapter<UpdataBean, BaseViewHolder> {

    public OfflineAdapter() {
        super(R.layout.layout_item_offline);
        addChildClickViewIds(R.id.deleteBtn, R.id.updataBtn);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder holder, UpdataBean bean) {
        holder.setText(R.id.tvDept, bean.getDept());
        holder.setText(R.id.tvName, bean.getCrop());
        holder.setText(R.id.tvArea, bean.getArea() + "亩");
        holder.setText(R.id.tvPos, bean.getLat() + "," + bean.getLon());
        holder.setText(R.id.tvSave, bean.getSavetime());
        ImageView imageView = holder.getView(R.id.imageView);
        Glide.with(getContext())
                .load(bean.getPath())
                .error(R.drawable.picture_icon_placeholder)
                .placeholder(R.drawable.picture_icon_placeholder)
                .into(imageView);
    }
}
